package com.hgkx.controller;

import com.alibaba.fastjson.JSONObject;
import com.hgkx.domain.MessageBoard;
import com.hgkx.service.MessageBoardService;
import com.hgkx.util.MailUtil;
import com.hgkx.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.javamail.JavaMailSenderImpl;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 留言
 */
@RestController
@RequestMapping("/messageBoard")
public class MessageBoardController {

    @Autowired
    MessageBoardService messageService;

    @RequestMapping("/saveMessageBoard")
    public JSONObject saveMessageBoard(MessageBoard board){
        try {
            messageService.saveMessageBoard(board);
        }catch (Exception e){
            return R.error();
        }
        return R.success();
    }
}
